<?php

Yii::import('crm.models._base.BaseRedSocial');

class RedSocial extends BaseRedSocial {

    /**
     * @return RedSocial
     */
    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    public static function label($n = 1) {
        return Yii::t('app', 'Red Social|Redes Sociales', $n);
    }
    public function rules() {
        return array_merge(parent::rules(), array(
            array('valor', 'url'),
        ));
    }
    public function search() {
        $criteria = new CDbCriteria;
        $criteria->compare('entidad_tipo', $this->entidad_tipo);
        $criteria->compare('entidad_id', $this->entidad_id);

        return new CActiveDataProvider($this, array(
            'criteria' => $criteria,
            'pagination' => array(
                'pageSize' => 5,
            ),
        ));
    }

}
